package impl

import (
	"game/src/common"
)

var _ common.IRouter = &BaseRouter{}

type BaseRouter struct {
	msgId int
}

func (b BaseRouter) PreHandle(request common.IRequest) bool {
	_, err := request.GetConnection().GetProperty("role")
	if err != nil && request.GetMsgID() != 1 {
		request.GetConnection().SendBuffMsg(0, []byte("未登录，请重新登录"))
		return false
	}
	return true
}

func (b BaseRouter) Handle(request common.IRequest) {
}

func (b BaseRouter) PostHandle(request common.IRequest) {
}
